package com.ajavaer.framework.config;

import com.ajavaer.framework.common.validate.annotation.CheckField;
import com.ajavaer.framework.generator.type.JpaNamingType;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@ComponentScan(basePackages = {"com.ajavaer.framework.config", "com.ajavaer.framework.generator"})
@ConfigurationProperties(prefix = "ajavaer.generator")
public class GeneratorConfig {
    private String database = "";
    /**
     * 表前缀
     */
    private String tablePrefix = "";
    private String superPoClass = "";
    /**
     * 主键类型,Integer,Long(默认),String
     */
    private String pkType = "Long";
    @CheckField(notEmpty = true, message = "要生成的表名不能为空")
    private String tables;
    private JpaNamingType jpaNamingType = JpaNamingType.hump;
    @CheckField(notEmpty = true, message = "输出目录不能为空")
    private String outDir;
    @CheckField(notEmpty = true, message = "模版目录不能为空")
    private String templateDir;
    @CheckField(notEmpty = true, message = "po包路径不能为空")
    private String poPackage;
    private String dtoPackage;
    private String dtoMapperPackage;
    @CheckField(notEmpty = true, message = "dao包路径不能为空")
    private String daoPackage;
    @CheckField(notEmpty = true, message = "service包路径不能为空")
    private String servicePackage;
    /**
     * controller包路径,可选;不填则不生成controller
     */
    private String controllerPackage;

    public String getTemplateDir() {
        return templateDir;
    }

    public void setTemplateDir(String templateDir) {
        this.templateDir = templateDir;
    }

    public String getDatabase() {
        return database;
    }

    public void setDatabase(String database) {
        this.database = database;
    }

    public String getTables() {
        return tables;
    }

    public void setTables(String tables) {
        this.tables = tables;
    }

    public String getOutDir() {
        return outDir;
    }

    public void setOutDir(String outDir) {
        this.outDir = outDir;
    }

    public String getPoPackage() {
        return poPackage;
    }

    public void setPoPackage(String poPackage) {
        this.poPackage = poPackage;
    }

    public String getDaoPackage() {
        return daoPackage;
    }

    public void setDaoPackage(String daoPackage) {
        this.daoPackage = daoPackage;
    }

    public String getServicePackage() {
        return servicePackage;
    }

    public void setServicePackage(String servicePackage) {
        this.servicePackage = servicePackage;
    }

    public String getTablePrefix() {
        return tablePrefix;
    }

    public void setTablePrefix(String tablePrefix) {
        this.tablePrefix = tablePrefix;
    }

    public String getSuperPoClass() {
        return superPoClass;
    }

    public void setSuperPoClass(String superPoClass) {
        this.superPoClass = superPoClass;
    }

    public String getControllerPackage() {
        return controllerPackage;
    }

    public void setControllerPackage(String controllerPackage) {
        this.controllerPackage = controllerPackage;
    }

    public JpaNamingType getJpaNamingType() {
        return jpaNamingType;
    }

    public void setJpaNamingType(JpaNamingType jpaNamingType) {
        this.jpaNamingType = jpaNamingType;
    }

    public String getDtoPackage() {
        return dtoPackage;
    }

    public void setDtoPackage(String dtoPackage) {
        this.dtoPackage = dtoPackage;
    }

    public String getDtoMapperPackage() {
        return dtoMapperPackage;
    }

    public void setDtoMapperPackage(String dtoMapperPackage) {
        this.dtoMapperPackage = dtoMapperPackage;
    }

    public String getPkType() {
        return pkType;
    }

    public void setPkType(String pkType) {
        this.pkType = pkType;
    }
}
